require "Common/class"
require "Common/Base/BaseCtrl"
require "View/SettingPanel"
--设置面板控制器类
--create by lwt
--date 2018-4-23
SettingCtrl = class("SettingCtrl",BaseCtrl)

function SettingCtrl:Awake(resName)
	self.curPanel = SettingPanel.New("SettingPanel")
	self.super:Awake(resName,self)
end

function SettingCtrl:ShowPanel(data)
	self.super.ShowPanel(self,data)
end

function SettingCtrl:InitCtrl()
end

function SettingCtrl:AddUIEvent()	
	self.luaBehaviour:AddClick(self.curPanel.closeBtn,function ()
		if ButtonHandle:ClickFastHand() then return end
		self:ClosePanel()
	end)

	self.luaBehaviour:AddToggle(self.curPanel.toggleM,function (go,isOn)
		self:Toggle_Music(go,isOn)
	end)
end

function SettingCtrl:AddListener()
	
end

function SettingCtrl:RemoveListener()
	
end

function SettingCtrl:Toggle_Music(go,isOn)
	look(isOn)
	logError("==================点击了Toggle按钮===================")
end